package inheritedPanel;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Toolkit;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JSplitPane;

public class DefaultPanel extends JPanel{
	private static final long serialVersionUID = 1L;
	Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
	int w = size.width, h = size.height;	 
	
	public void setPanel(){
		setLayout(new BorderLayout());		
		lblCopyRight = new JLabel("Copyright By Code's Done Company");		
		panelTop = new JPanel(new BorderLayout());
		panelTLogo = new JPanel(new BorderLayout());
		panelTMenu = new JPanel();
		panelCenter = new JPanel(new BorderLayout());
		panelCLeft = new JPanel(new BorderLayout());
		panelButtom = new JPanel(new BorderLayout());
		desktopPane = new JDesktopPane();
		internalFrame = new JInternalFrame();
		
		panelTop.setPreferredSize(new Dimension(w, (int)(w*0.08)));
		panelCLeft.setPreferredSize(new Dimension((int)(w*0.25), (int)(w*0.80)));
		desktopPane.setPreferredSize(new Dimension((int)(w*0.75), (int)(w*0.80)));
		panelButtom.setPreferredSize(new Dimension(w, (int)(w*0.02)));

		splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panelCLeft, desktopPane);
		
		panelTop.setBackground(new Color(83,83,83));
		panelCLeft.setBackground(new Color(210,71,38));
		panelButtom.setBackground(new Color(83,83,83));
		
		lblCopyRight.setForeground(new Color(255,255,255));
        lblCopyRight.setFont(new Font("Segoe UI", Font.PLAIN, 12));

        if(!desktopPane.isVisible()){
        	desktopPane.setVisible(true);
        }
        
        desktopPane.add(internalFrame);
        
        panelTop.add(new TopMenuLogo(), BorderLayout.WEST);
        panelTop.add(new TopMenuIcon(), BorderLayout.CENTER);
        panelCenter.add(splitPane);
		panelButtom.add(lblCopyRight, BorderLayout.EAST);
		
		add(panelTop, BorderLayout.NORTH);
		add(panelCenter, BorderLayout.CENTER);
		add(panelButtom, BorderLayout.SOUTH);		
	}
	
	/*
	 * @variable
	 */
	JPanel panelTop;
	JPanel panelTLogo;
	JPanel panelTMenu;
	JPanel panelCenter;
	JPanel panelCLeft;
	JPanel panelButtom;
	JLabel lblCopyRight;
	JSplitPane splitPane;
	JDesktopPane desktopPane;
	JInternalFrame internalFrame;
}
